#include "dblDele.h"
#include <QLineEdit>
    QWidget * DoubleDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,const QModelIndex &index) const
    {
        Q_UNUSED(option)
        Q_UNUSED(index)
        QLineEdit *editor = new QLineEdit(parent);
        return editor;
    }
    void DoubleDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
    {
        double value = index.model()->data(index).toDouble();
        QLineEdit *line = static_cast<QLineEdit*>(editor);
        line->setText(QString::number(value));
    }
    void DoubleDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index) const
    {
        QLineEdit *line = static_cast<QLineEdit*>(editor);
        //spinBox->interpretText();
        double value = line->text().toDouble();
        model->setData(index, value);
    }
    void DoubleDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
    {
        Q_UNUSED(index)
        editor->setGeometry(option.rect);
    }
